﻿using T4UtilityBelt.Writers;

namespace T4UtilityBelt.UxDesigns.Controls.Renderers.Windows
{
    public class ItemTemplateRenderer : ControlRenderer<ItemTemplateControl, IItemTemplateRenderer>, IItemTemplateRenderer
    {
        protected override void OnRenderUiXmlBegin(ItemTemplateControl control, CodeWriter writer)
        {
            // todo make the Type name a property of the control
            writer.WriteBeginTag("DataTemplate");
            //RenderControlAttributes(control, writer);
            writer.WriteEnd();
        }

        protected override void OnRenderUiXmlContent(ItemTemplateControl control, CodeWriter writer)
        {
            control.Controls.RenderUiXml(writer);
        }

        protected override void OnRenderUiXmlEnd(ItemTemplateControl control, CodeWriter writer)
        {
            writer.WriteEndTag("DataTemplate");
        }
    }
}